Linux Error Exit Code

The following example shows that any device failure will return 1 (error).

$ efa inventory device interface set-admin-state --ip 10.139.44.175-177 --if-type eth --if-name 0/1 --state up
+---------------+-----+------+-----------+--------+---------+------------------------+
|   DeviceIP    | ID  | Name | Interface | Admin  | Result  |         Reason         |
|               |     |      | Type      } Status |         |                        |
+---------------+-----+------+-----------+--------+---------+------------------------+
| 10.139.44.176 |     |      |           |        | Failed  | Device does not exist  |
|               |     |      |           }        |         | with IP: 10.139.44.176 |
+---------------+-----+------+-----------+--------+---------+------------------------+
| 10.139.44.177 |     |      |           |        | Failed  | Device does not exist  |
|               |     |      |           }        |         | with IP: 10.139.44.177 |
+---------------+-----+------+-----------+--------+---------+------------------------+
| 10.139.44.175 | 297 | 0/1  | ethernet  | up     | Success |                        |
+---------------+-----+------+-----------+--------+---------+------------------------+
Interface Details
--- Time Elapsed: 23.384583544s ---
$ echo $?
1
Note

Note

The last line shows 0 instead of 1 even when at least one "Failed" result is reported.